package com.study.day20190709;

import java.util.ArrayList;
import java.util.List;

public class StreamThreadTest {
    public static void main(String[] args) {
        List<Integer> list=new ArrayList<Integer>();
        list.add(10);
        list.add(20);
        list.add(30);
        list.add(40);
        int result=list.parallelStream().mapToInt(p->p*2).sum();
        System.out.println(result);
        list.parallelStream().forEach(p->System.out.println(p));
    }
}
